# -*- coding: utf-8; mode: snippet -*-
# name: slice and get sum of array
# key: sum
# contributor: Chen Bin <chenbin.sh AT gmail>
# --
$0.slice(0,i).reduce((a,b) => a+b, 0)